<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "/header.html">
</head>
<style>
    .el-table .warning-col {
        background: #ff00008a;
        color: white;
    }
</style>
<body>
<div id="rrapp" v-cloak>
    <!--提现订单列表-->
    <div v-show="showList">
        <!--查询-->
        <el-form :inline="true" size="mini" >
            <el-form-item label="申请id">
                <el-input v-model="q.id" placeholder="申请id"></el-input>
            </el-form-item>
            <el-form-item label="联动单号">
                <el-input v-model="q.payNo" placeholder="联动单号"></el-input>
            </el-form-item>
            <el-form-item label="工厂">
                <el-select
                        v-model="q.sellerId"
                        filterable
                        clearable
                        remote
                        reserve-keyword
                        placeholder="请输入工厂名称"
                        :remote-method="remoteMethod"
                        :loading="loading">
                    <el-option
                            v-for="item in sellerList"
                            :key="item.sellerId"
                            :label="item.sellerName"
                            :value="item.sellerId">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="提现状态">
                <el-select v-model="q.applyStatus" clearable placeholder="请选择">
                    <el-option
                            v-for="item in applyStatusList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-button icon="el-icon-search" @click="query" circle></el-button>
            </el-form-item>
        </el-form>

        <!--工厂提现主表表格-->
        <el-table size="mini" :data="applyCashFactoryData" border stripe show-overflow-tooltip="true" style="width: 100%">

            <el-table-column    type="index"  label="#"  >  </el-table-column>

            <el-table-column    label="操作"  >
                <template slot-scope="scope">
                    <el-button
                            type="text"
                            size="mini"
                            @click="goDetail(scope.row.id)">{{scope.row.applyStatus ==0?'审核':'查看'}}</el-button>
                    </el-button>
                </template>
            </el-table-column>

            <el-table-column    prop="id"  label="申请id"  >  </el-table-column>

            <el-table-column    prop="payNo"  label="联动单号" width="150"  >  </el-table-column>

            <el-table-column    prop="merchantName"  label="商户"  width="200">  </el-table-column>

            <el-table-column    prop="applyStatusText"  label="申请状态"  >  </el-table-column>

            <el-table-column    prop="applyMoney"  label="提现金额"  >  </el-table-column>

            <el-table-column    prop="applyFee"  label="提现汇费"  >  </el-table-column>

            <el-table-column    prop="expectDate"  label="预计到账日期" width="150"  >  </el-table-column>

            <el-table-column    prop="actualTime"  label="实际到账时间"  width="150"  >  </el-table-column>

            <el-table-column    prop="applyUser"  label="申请人" width="200" >  </el-table-column>

            <el-table-column    prop="applyTime"  label="申请时间" width="150"  >  </el-table-column>

            <el-table-column    prop="auditor"  label="审核人"  >  </el-table-column>

            <el-table-column    prop="auditTime"  label="审核时间" width="150"  >  </el-table-column>

            <el-table-column    prop="remark"  label="备注"  >  </el-table-column>

        </el-table>

        <!--分页插件-->
        <div style="text-align: center;margin: 15px">
            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="page.currentPage"
                    :page-sizes="page.pageSizes"
                    :page-size="page.pageSize"
                    layout="total, sizes, prev, pager, next"
                    :total="page.total">
            </el-pagination>
        </div>
    </div>

    <!--提现订单明细-->
    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">操作</div>
        <div style="padding: 10px; text-align:center">
            <el-button size="small" type="primary" icon="el-icon-check" @click="check">审核</el-button>
            <el-button size="small" type="danger" icon="el-icon-close" @click="reject">驳回</el-button>
            <el-button size="small" type="warning" icon="el-icon-search"  v-if="merchantApplyCash.applyStatus >0"  @click="search">实时查看</el-button>
            <el-button size="small" icon="el-icon-back" @click="goBack">返回</el-button>
        </div>


        <div class="panel-heading">单据信息</div>
        <div style="padding: 10px;">
            <el-form :inline="true" size="mini" :model="merchantApplyCash" class="demo-form-inline" label-width="80px">
                <el-form-item label="单据编号">
                    <el-input v-model="merchantApplyCash.id" disabled ></el-input>
                </el-form-item>
                <el-form-item label="供应商">
                    <el-input v-model="merchantApplyCash.merchantName" disabled></el-input>
                </el-form-item>
                <el-form-item label="单据状态">
                    <el-input v-model="merchantApplyCash.applyStatusText" disabled></el-input>
                </el-form-item>
                <el-form-item label="申请金额">
                    <el-input v-model="merchantApplyCash.applyMoney" disabled></el-input>
                </el-form-item>
                <el-form-item label="汇费">
                    <el-input v-model="merchantApplyCash.applyFee" disabled></el-input>
                </el-form-item>
                <el-form-item label="申请人">
                    <el-input v-model="merchantApplyCash.applyUserName" disabled></el-input>
                </el-form-item>
                <el-form-item label="提交时间">
                    <el-input v-model="merchantApplyCash.applyTime" disabled></el-input>
                </el-form-item>
                <el-form-item label="审核人">
                    <el-input v-model="merchantApplyCash.auditorName" disabled></el-input>
                </el-form-item>
                <el-form-item label="审核时间">
                    <el-input v-model="merchantApplyCash.auditTime" disabled></el-input>
                </el-form-item>
                <el-form-item label="备注">
                    <el-input v-model="merchantApplyCash.remark" disabled></el-input>
                </el-form-item>
            </el-form>
        </div>
        <div class="panel-heading">单据详情</div>
        <div style="padding: 10px;">
            <el-table size="mini" :data="merchantApplyCashItems"
                      border
                      stripe
                      show-overflow-tooltip="true"
                      :header-cell-class-name="rowClass"
                      style="width: 100%">
                <!-- ============原始订单信息==============-->

                <el-table-column    label="原订单号"  prop="originalOrderId" > </el-table-column>

                <el-table-column    label="门店"  prop="originalSellerName"></el-table-column>

                <el-table-column    label="下单时间"  prop="originalOrderCreateTime"></el-table-column>

                <el-table-column    label="订单收款金额" prop="originalPayed"> </el-table-column>

                <el-table-column    label="支付时间" prop="originalPaymentTime"></el-table-column>

                <el-table-column    label="订单完成时间" prop="originalReceivedTime"> </el-table-column>

                <!-- ============分配订单信息==============-->
                <el-table-column    label="分配订单号" prop="orderId"></el-table-column>

                <el-table-column    label="下单时间" prop="orderCreateTime"> </el-table-column>

                 <el-table-column    label="支付时间" prop="paymentTime"></el-table-column>

                <el-table-column    label="订单打款金额" prop="payed" ></el-table-column>

                <el-table-column    label="订单完成时间" prop="finishTime"></el-table-column>
            </el-table>
        </div>
        <div class="panel-heading">操作日志</div>
        <div style="padding: 10px;">
            <el-table size="mini" :data="merchantApplyLog" border stripe show-overflow-tooltip="true" style="width: 100%">

                <el-table-column    type="index"  label="#"  >  </el-table-column>

                <el-table-column    prop="applyCashId"  label="单据编号" width="80" >  </el-table-column>

                <el-table-column    prop="applyLogStatus"  label="日志状态" width="90"  >
                    <template slot-scope="scope">
                    <el-tag size="small" v-if="scope.row.applyLogStatus ==0">支付中</el-tag>
                        <el-tag size="small" type="danger" v-if="scope.row.applyLogStatus ==1">支付失败</el-tag>
                        <el-tag size="small" type="success" v-if="scope.row.applyLogStatus ==2">支付成功</el-tag>
                    </template>
                </el-table-column>

                <el-table-column    prop="applyPayId"  label="支付ID"  width="180">  </el-table-column>

                <el-table-column    prop="payNo"  label="联动提现单号"  width="180">  </el-table-column>

                <el-table-column    prop="message"  label="提现信息"  width="260">  </el-table-column>

                <el-table-column    prop="bankNo"  label="银行卡号"  width="180">  </el-table-column>

                <el-table-column    prop="bankOwner"  label="银行卡持有人"  width="200">  </el-table-column>

                <el-table-column    prop="bank"  label="银行"   width="200">  </el-table-column>

                <el-table-column    prop="mobile"  label="预留手机"  width="100"  >  </el-table-column>

                <el-table-column    prop="createTime"  label="创建时间" width="160" >  </el-table-column>

                <el-table-column    prop="remark"  label="备注" width="180" >  </el-table-column>

            </el-table>

        </div>
        <!--订单查询结果弹窗-->
        <el-dialog
                size="mini"
                center
                title="订单查询结果"
                :visible.sync="searchResultVisible"
                width="500px"
        >
            <el-form label-width="80px" size="small">
                <el-form-item label="申请单号:" >
                    <el-input v-model="merchantApplyCash.id" readonly></el-input>
                </el-form-item>
                <el-form-item label="联动单号:" >
                    <el-input v-model="merchantApplyCash.applyPayId" readonly></el-input>
                </el-form-item>
                <el-form-item label="状态码:" >
                    <el-input v-model="searchResult.code" readonly></el-input>
                </el-form-item>
                <el-form-item label="状态:" >
                    <el-input v-model="searchResult.message" readonly></el-input>
                </el-form-item>
            </el-form>
            <span slot="footer" class="dialog-footer">
               <!--重置状态需要 满足当前订单状态为失败4 同时查询订单状态也为失败1552-->
            <el-button size="mini" v-if="merchantApplyCash.applyStatus === 4 && searchResult.code === 1552" @click="resetApplyStatus" type="danger" >重置审核状态</el-button>
                <!--确认打款需要 满足当前订单状态为1 审核通过 同时查询订单状态为成功1554-->
            <el-button size="mini" v-if="merchantApplyCash.applyStatus === 1 && searchResult.code === 1554" @click="confirmCash" type="warning" >确认已打款</el-button>
            <el-button size="mini" @click="searchResultVisible = false">取 消</el-button>
          </span>
        </el-dialog>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/capital/applyCashFactoryCheck.js?_${.now?long}"></script>
</body>
</html>